<?php
/* @var $this PeriodoslectivosController */
/* @var $model Periodoslectivos */
/* @var $form bootstrap.widgets.TbActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'periodoslectivos-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of bootstrap.widgets.TbActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Los campos con <span class="required">*</span> Son Requeridos.</p>
	<p class="note1">Hacer click en la imagen del calendario. Para ingresar la fecha.</p>

	<?php echo $form->errorSummary($model); ?>

	<!-- <div class="row">
		<?php echo $form->labelEx($model,'inicio'); ?>
		<?php echo $form->textField($model,'inicio'); ?>
		<?php echo $form->error($model,'inicio'); ?>
	</div>
 -->
	 <div class="row">
		 <?php echo $form->labelEx($model,'Inicio del Periodo Lectivo'); ?>
		 <?php
		 if ($model->inicio!='') {
			 $model->inicio=date('d-m-Y',strtotime($model->inicio));
		 }
		 $this->widget('zii.widgets.jui.CJuiDatePicker', array(
		 'model'=>$model,
		 'attribute'=>'inicio',
		 'value'=>$model->inicio,
		 'language' => 'es',
		 'htmlOptions' => array('readonly'=>"readonly"),
		 
		 'options'=>array(
		 'autoSize'=>true,
		 'defaultDate'=>$model->inicio,
		 'dateFormat'=>'dd-mm-yy',
		 'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png',
		 'buttonImageOnly'=>true,
		 'buttonText'=>'Fecha',
		 'selectOtherMonths'=>true,
		 'showAnim'=>'slide',
		 'showButtonPanel'=>true,
		 'showOn'=>'button',
		 'showOtherMonths'=>true,
		 'changeMonth' => 'true',
		 'changeYear' => 'true',
		 ),
		 )); ?>
		 <?php echo $form->error($model,'inicio'); ?>
	 </div>

	 <div class="row">
		 <?php echo $form->labelEx($model,'Fin del Periodo Lectivo'); ?>
		 <?php
		 if ($model->fin!='') {
			 $model->fin=date('d-m-Y',strtotime($model->fin));
		 }
		 $this->widget('zii.widgets.jui.CJuiDatePicker', array(
		 'model'=>$model,
		 'attribute'=>'fin',
		 'value'=>$model->fin,
		 'language' => 'es',
		 'htmlOptions' => array('readonly'=>"readonly"),

		 'options'=>array(
		 'autoSize'=>true,
		 'defaultDate'=>$model->fin,
		 'dateFormat'=>'dd-mm-yy',
		 'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png',
		 'buttonImageOnly'=>true,
		 'buttonText'=>'Fecha',
		 'selectOtherMonths'=>true,
		 'showAnim'=>'slide',
		 'showButtonPanel'=>true,
		 'showOn'=>'button',
		 'showOtherMonths'=>true,
		 'changeMonth' => 'true',
		 'changeYear' => 'true',
		 ),
		 )); ?>
		 <?php echo $form->error($model,'fin'); ?>
	 </div>

	<div class="row">
		<?php echo $form->labelEx($model,'periodo actual'); ?>
		<?php echo $form->checkBox($model,'periodo_actual'); ?>
		<?php echo $form->error($model,'periodo_actual'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->